Skip to content

Increase read timeout for sagemaker runtime #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 21, 2018
Merged

Increase read timeout for sagemaker runtime #355

merged 5 commits into from
Aug 21, 2018

Conversation

ChoiByungWook
Copy link
Contributor

Increase read timeout for SageMaker runtime, as the hosting endpoint has a time limit on how long an inference can take.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-io
Copy link

codecov-io commented Aug 17, 2018

Codecov Report

Merging #355 into master will increase coverage by 0.14%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #355      +/-   ##
==========================================
+ Coverage   92.92%   93.07%   +0.14%     
==========================================
  Files          51       51              
  Lines        3564     3567       +3     
==========================================
+ Hits         3312     3320       +8     
+ Misses        252      247       -5
Impacted Files Coverage Δ
src/sagemaker/session.py 88.86% <75%> (-0.17%) ⬇️
src/sagemaker/local/image.py 89.18% <0%> (+1.8%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e61265...65b9446. Read the comment docs.

self.sagemaker_runtime_client = sagemaker_runtime_client or self.boto_session.client('runtime.sagemaker')
config = botocore.config.Config(read_timeout=80)
self.sagemaker_runtime_client = sagemaker_runtime_client or self.boto_session.client('runtime.sagemaker',
config=config)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be better to create config only when needed (i.e. only when sagemaker_runtime_client is None), and since there's an awkward line break with this change now, I think I'm more inclined toward

if sagemaker_runtime_client is not None:
    self.sagemaker_runtime_client = sagemaker_runtime_client
else:
    config = botocore.config.Config(read_timeout=80)
    self.sagemaker_runtime_client = self.boto_session.client('runtime.sagemaker', config=config)

personal preference, though, and not a strong one at that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Updating.

@ChoiByungWook ChoiByungWook merged commit 081c68a into aws:master Aug 21, 2018
pdasamzn pushed a commit to pdasamzn/sagemaker-python-sdk that referenced this pull request Nov 1, 2018
apacker pushed a commit to apacker/sagemaker-python-sdk that referenced this pull request Nov 15, 2018
Disable MKL for TensorFlow iris example to get a better performance.
@ChoiByungWook ChoiByungWook deleted the hosting_timeout branch December 1, 2020 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants